<extend name="Public/header"/>
<block name="main">
<body class="bgeee">
    <div class="header-container">
        <div class="weui-cell">
            <div class="weui-cell__hd fs0">
                <img src="__WEBPUBLIC__/Home/img/lefticon.png" class="slimg" />
            </div>
            <div class="weui-cell__bd texcen">
                <p>登录</p>
            </div>
        </div>
    </div>
    <div class="xq_container">
        <div class="weui-cells uinput ">
            <div class="weui-cell">
                <div class="weui-cell__hd">手机号</div>
                <div class="weui-cell__bd">
                    <input type="tel" name="" class="weui-input account" placeholder="输入您的手机号码" />
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">验证码</div>
                <div class="weui-cell__bd">
                    <input type="text" name="" class="weui-input code" placeholder="输入短信验证码" />
                </div>
                <div class="fs0">
                    <a class="weui-btn weui-btn_mini bgff0 fs0-8 getcode">点击获取</a>
                </div>
            </div>
            
        </div>
        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips">登录</a>
        </div>
    </div>
</body>
</block>
<block name="footerjs">
    <script>
        getCode("{:U('Member/getCode')}");
        $("#showTooltips").on('click',function () {
            var tel = $(".account").val();
            var code = $(".code").val();
            if (tel && code){
                requestUrl("{:U('Member/register')}",{"tel":tel,"code":code},function ( res ) {
                    console.log( res );
                    if (res.flag == "success") {
                        window.location.href = "{:U('Index/index')}";
                    }else{
                        layer.msg(res.message);
                    }
                });
            }else{
                layer.msg("手机号或验证码不能为空！");
            }
        });
    </script>
</block>